package com.hlingsoft.kkh.entity;

import com.hlingsoft.kkh.constant.EventCommentsConstant;
import com.hlingsoft.kkh.constant.UserConstant;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class Event {

	/**
	 * 主键
	 */
	private long id;

	/**
	 * 标题
	 */
	private String title;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 开始时间
	 */
	private Date startTime;

	/**
	 * 开始时间
	 */
	private Date startTime2;

	/**
	 * 开始时间
	 */
	private Date startTime3;

	private Date createTime;

	
	
	private String startTimeStr;
	private String startTimeStr2;
	private String startTimeStr3;
	/**
	 * 结束时间
	 */
	private Date endTime;

	// 人均消费
	private String perCapita;
	
	// 人均消费
	private int perCapitaInt;

	// 确定活动时间
	private Date confirmstartTime;

	/**
	 * 活动地点
	 */
	private String address;
	/**
	 * 售价
	 * 
	 */
	private int price;
	/**
	 * 总数
	 */
	private int amount;

	private int buyCount;

	/**
	 * 活动图片
	 */
	private String pic;

	private String type;// show

	private EventCommentsConstant.CreateBySource source;

	private EventCommentsConstant.Visibility visibility;//

	private Long ids[];// 邀请人的ID集合
	private String phones[];// 通讯录邀请人的结合
	private String createByUserId;// 创建人ID

	private List<User> users;// 参加者的简单信息

	private int joinNum;

	private String userNickname;
	private UserConstant.Gender userGender;
	private String userHeadPortrait;

	private int priaseNum; 
	private int commentNum;
	private String ticketUrl;

	private float latitude;// 纬度
	private float longitude;// 经度

	 
	/**
	 * 活动状态:已完成,进行中,已确认
	 */
	private EventCommentsConstant.StatusFlag statusFlag;
	
	
	private String status;

	/**
	 * 是否还可以赞
	 */
	private boolean canPriase;
	
	
	private int top;

	
	
	public boolean isCanPriase() {
		return canPriase;
	}

	public void setCanPriase(boolean canPriase) {
		this.canPriase = canPriase;
	}

	public float getLatitude() {
		return latitude;
	}

	public void setLatitude(float latitude) {
		this.latitude = latitude;
	}

	public float getLongitude() {
		return longitude;
	}

	public void setLongitude(float longitude) {
		this.longitude = longitude;
	}

	public int getPriaseNum() {
		return priaseNum;
	}

	public void setPriaseNum(int priaseNum) {
		this.priaseNum = priaseNum;
	}

	public int getCommentNum() {
		return commentNum;
	}

	public void setCommentNum(int commentNum) {
		this.commentNum = commentNum;
	}

	public int getTop() {
		return top;
	}

	public void setTop(int top) {
		this.top = top;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public String getCreateByUserId() {
		return createByUserId;
	}

	public void setCreateByUserId(String createByUserId) {
		this.createByUserId = createByUserId;
	}

	public List<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	public int getBuyCount() {
		return buyCount;
	}

	public void setBuyCount(int buyCount) {
		this.buyCount = buyCount;
	}

	public boolean canBuy() {
		return this.amount - this.buyCount > 0;
	}

	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getUserNickname() {
		return userNickname;
	}

	public void setUserNickname(String userNickname) {
		this.userNickname = userNickname;
	}

	public String getUserHeadPortrait() {
		return userHeadPortrait;
	}

	public void setUserHeadPortrait(String userHeadPortrait) {
		this.userHeadPortrait = userHeadPortrait;
	}

	public Date getStartTime2() {
		return startTime2;
	}

	public void setStartTime2(Date startTime2) {
		this.startTime2 = startTime2;
	}

	public Date getStartTime3() {
		return startTime3;
	}

	public void setStartTime3(Date startTime3) {
		this.startTime3 = startTime3;
	}

	public String getPerCapita() {
		return perCapita;
	}

	public void setPerCapita(String perCapita) {
		this.perCapita = perCapita;
	}

	public int getJoinNum() {
		return joinNum;
	}

	public void setJoinNum(int joinNum) {
		this.joinNum = joinNum;
	}

	public String getStartTimeStr() {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		return sf.format(this.getStartTime());
	}

	public String getStartTime2Str() {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		return sf.format(this.getStartTime2());
	}

	public String getStartTime3Str() {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		return sf.format(this.getStartTime3());
	}

	public String getConfirmstartTimeStr() {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		if(this.getConfirmstartTime()==null){
			return "";
		}
		return sf.format(this.getConfirmstartTime());
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public EventCommentsConstant.Visibility getVisibility() {
		return visibility;
	}

	public void setVisibility(EventCommentsConstant.Visibility visibility) {
		this.visibility = visibility;
	}


	public EventCommentsConstant.StatusFlag getStatusFlag() {
		return statusFlag;
	}

	public void setStatusFlag(EventCommentsConstant.StatusFlag statusFlag) {
		this.statusFlag = statusFlag;
	}

	public EventCommentsConstant.CreateBySource getSource() {
		return source;
	}

	public void setSource(EventCommentsConstant.CreateBySource source) {
		this.source = source;
	}

	public Long[] getIds() {
		return ids;
	}

	public void setIds(Long[] ids) {
		this.ids = ids;
	}

	public String[] getPhones() {
		return phones;
	}

	public void setPhones(String[] phones) {
		this.phones = phones;
	}



	public Date getConfirmstartTime() {
		return confirmstartTime;
	}

	public void setConfirmstartTime(Date confirmstartTime) {
		this.confirmstartTime = confirmstartTime;
	}

	public String getTicketUrl() {
		return ticketUrl;
	}

	public void setTicketUrl(String ticketUrl) {
		this.ticketUrl = ticketUrl;
	}

	public String getStartTimeStr2() {
		return startTimeStr2;
	}

	public void setStartTimeStr2(String startTimeStr2) {
		
		
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		this.startTimeStr2 = startTimeStr2;
		try {
			if(this.startTimeStr2!=""){
			this.startTime2=sf.parse(this.startTimeStr2);
			}else{
				this.startTime2=this.startTime;
			}
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}

	public String getStartTimeStr3() {
		return startTimeStr3;
	}

	public void setStartTimeStr3(String startTimeStr3) {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		this.startTimeStr3 = startTimeStr3;
		try {
			if(this.startTimeStr3!=""){
			this.startTime3=sf.parse(this.startTimeStr3);
			}else{
				this.startTime3=this.startTime;
			}
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}

	public void setStartTimeStr(String startTimeStr) {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		this.startTimeStr = startTimeStr;
		try {
			this.startTime=sf.parse(this.startTimeStr);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		
	}
	
	

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public UserConstant.Gender getUserGender() {
		return userGender;
	}

	public void setUserGender(UserConstant.Gender userGender) {
		this.userGender = userGender;
	}

	public int getPerCapitaInt() {
		return perCapitaInt;
	}

	public void setPerCapitaInt(int perCapitaInt) {
		this.perCapitaInt = perCapitaInt;
	}

	 
	 
	
	

}
